@extends('host.custom.common.common')

@section('c-head')
    <script>

        PAGE_DATA = {
            pagingObj : {
                total : "0",
                pageSize : "7",
                page : "1"
            }
        };

    </script>

    <style>
        div[id='content:del-classify-dialog'] {
            color: red;
            font-size: 18px;
        }

        div.error-line{
            text-align: center;
        }

    </style>
@stop

@section('body')
        <!-- top_test -->
<div id="top_test"></div>
<!-- web_logo_search -->
<div id="web_logo_search"></div>
<!-- comm_nav -->
<div id="comm_nav"></div>
<div class="com-w mt20">
    <div class="wrapper clearfix">
        <div class="w220 mr20 comm-left-menu">
            <div class="menu-top-title">
                供应商中心
            </div>
            <div id="leftmenuitems">
            </div>
        </div>
        <!-- main-context -->
        <div class="w960 comm-main">
            <div class="main-release clearfix">
                <div class="main-release-nav">您当前的位置：首页 > 供应商中心</div>
                <div class="main-release-title">
                    <span class="icons"></span>
                    <span class="release-title-h3 f16">分类管理</span>
                </div>
                <div class="main-release-from">
                    <div class="h60 w960">
                        <div class="admin-shop f14 S18">
                                <span class="btn btn-default btn-w100x32" id="add-classify">
                                    新增分类
                                </span>
                        </div>
                    </div>
                    <div class="comm-tbl add-classify-admin">
                        <div class="head">
                            <ul class="clearfix">
                                <li class="w25" style="width: 25%">分类名称</li>
                                <li class="w25" style="width: 25%">显示</li>
                                <li style="width: 10%">排序</li>
                                <li style="width: 40%">操作</li>
                            </ul>
                        </div>
                        <div id="commTabs_2_body" class="body clearfix fist-class">

                        </div>


                    </div>
                </div>
            </div>

            <div id="comm-paging" class="comm-paging" style="float: right;"></div>
        </div>

    </div>
</div>
<!-- foot_nav -->
<div id="foot_nav"></div>
<div id="bottom_main"></div>

<script type="text/template" id="add_classify_templ">
    <div class="dialog-div">
        <form id="new-classify-form">
            <div class="price-game-name">
        <span class="game-text">
            分类名称：
        </span>
                <input type="text" name="name" id="name" value="<%=name %>" />
            </div>
            <div class="price-game-name brand-classify">
        <span class="game-text">
            上级分类：
        </span>
                <select name="parent_id" id="parent_id">
                    <option value=""> 请选择</option>
                    <% _.each(superClassify, function(optionItem){ %>
                    <option value="<%=optionItem.code %>"><%=optionItem.text %></option>
                    <% });%>
                </select>
            </div>
            <div class="price-game-name">
        <span class="game-text">
            排序 ：
        </span>
                <input type="text" name="sort" id="sort" value="<%=sort %>" />
            </div>
            <div class="classify-show clearfix">
        <span class="game-text">
            显示：
        </span>

        <span>

           <input type="radio" name="display" id="display_1" value="1" <% if(display == "1") {%> checked <% }%> >
           <label for="display_1"> 是</label>
        </span>

        <span>
            <input type="radio" name="display" id="display_0" value="0" <% if(display == "0") {%> checked <% }%> >
			<label for="display_0">否</label>
        </span>
            </div>
            <div class="sub-btn">
                <div id="submit-btn" class="btn btn-warn btn-w140x40 sub">
                    提交
                </div>
                <input type="hidden" name="edit_id" id="edit_id" value="<% if(typeof edit_id != "undefined") { %><%=edit_id %><% } %>" />
            </div>
        </form>
    </div>
</script>

    <!-- 确认框 -->
    <script type="text/template" id="del-confirm">
        <div class="dialog-div">
            <div style="color:red;">确认删除此条数据?</div>
            <div class="price-game-btn">
                <span class="btn btn-gray btn-w140x40 remove">取消</span>
                <span class="btn btn-warn btn-w140x40" id="ok-btn">确定</span>
            </div>
        </div>
    </script>

<script type="text/template" id="classify_admin_templ">
    <%_.each(obj, function(item){ %>
    <ul class="clearfix classify-main" data-id="<%=item.id%>" <% if(item.has_child) {%> super="false" <% }%> >
        <li class="wb25">
            <% if(item.has_child) {%>
            <span class="add-mark"></span>
            <% } else {%>
            <span class="minus-mark"></span>
            <% }%>
            <span class="text f14 sel-name">
            <%=item.name%>
        </span>
        </li>
        <li class="wb25">
            <% if(item.is_visible) {%>
            <span class="i-check-yes" style="margin-left: 45%;margin-top: 5%;"></span>
            <% } else { %>
            <span class="i-check-no" style="margin-left: 45%;margin-top: 5%;"></span>
            <% }%>
        </li>
        <li style="color: #999;width: 10%">
            <%=item.sort%>
        </li>
        <li style="width: 40%">
            <% if(item.oper == "0") {%>
            <span class="btn btn-default btn-w70x32 cor sel-new-btn">新增下级</span>
            <% } else {%>
            <span class="btn btn-default btn-w70x32 cor" style="visibility:hidden;"></span>
            <% }%>
            <span class="btn btn-warn btn-w70x32 sel-edit-btn">
            编辑
        </span>
        <span class="btn btn-important btn-w70x32 sel-edit-del">
            删除
        </span>
        </li>
    </ul>
    <% if(item.has_child) {%>
    <% _.each(item.children,function(child){%>

    <ul class="clearfix classify-main-1" data-id="<%=child.id%>" super-id="<%=item.id%>" >
        <li class="wb25">

            <span class="minus-mark"></span>

        <span class="text f14 sel-name">
            <%=child.name%>
        </span>
        </li>
        <li class="wb25">
            <% if(child.is_visible) {%>
            <span class="i-check-yes" style="margin-left: 45%;margin-top: 5%;"></span>
            <% } else { %>
            <span class="i-check-no" style="margin-left: 45%;margin-top: 5%;"></span>
            <% }%>
        </li>
        <li style="color: #999;width: 10%">
            <%=child.sort%>
        </li>
        <li style="width: 40%">
            <span class="btn btn-default btn-w70x32 cor" style="visibility:hidden;"></span>
        <span class="btn btn-warn btn-w70x32 sel-edit-btn">
            编辑
        </span>
        <span class="btn btn-important btn-w70x32 sel-edit-del">
            删除
        </span>
        </li>
    </ul>
    <% });%>
    <% }%>

    <% }); %>

</script>

<!-- JS -->
<script src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
<script src="/assets/b2b/js/libs/messages_zh.js"></script>
<script src="/assets/b2b/js/libs/jquery.paging.min.js"></script>
<script src="/assets/b2b/js/libs/dialog-min.js"></script>

<script src="/assets/b2b/js/pageModules/supplyer/S18.js"></script>
@stop